/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: wwy
 * Date: 2024-11-10
 * Time: 15:02
 */
public class Test7 {
    public static void main(String[] args) {
        int a=24;
        int b=18;
        int c=a%b;
        while (c!=0){
            a=b;
            b=c;
            c=a%b;
        }
        System.out.println(b);
    }
}
